package com.simplefaith.delisty.client.packet;

import static com.simplefaith.delisty.client.packet.opcode.ClientOpCodes.C_Login;

import com.simplefaith.delisty.client.model.PacketWork;
import com.simplefaith.delisty.client.packet.manager.PacketManager;
import com.simplefaith.delisty.util.PacketUtil;

public class LoginPacket extends ClientPacket {

	public static final int opCode = C_Login;
	private String packet;

	public LoginPacket(String account, String password, PacketWork packetWork) {
		super(packetWork);

		//		
		packet = PacketUtil.ToPacket(String.valueOf(opCode),account,password);
		
		PacketManager.getInstance().sendClientPacket(this);
	}

	@Override
	public int getOpCode() {
		return opCode;
	}

	@Override
	public String getPacket() {
		return packet;
	}

	@Override
	public void ServerAcceptPacket() {
		super.getPacketWork().packetAccept();
	}

	@Override
	public void ServerRejectPacket() {
		super.getPacketWork().packetReject();
	}

}
